#pragma once
#include <vector>
#include "vec.h"
#include "material.h"
//#include "Lights.h"

typedef struct VertexData {
	vec2 m_colorBufferCoords;
	GLfloat m_zValueInNCS;
	vec3 m_normalInCamFrame;
	vec3 m_ambientColor;
	vec3 m_diffuseColor;
	vec3 m_specularColor;

	VertexData(	const vec2& w, const GLfloat & zVal, const vec3 & normalCam, const vec3 ambientColor,
				const vec3& diffuseColor, const vec3 & specularColor):
				m_colorBufferCoords(w),m_zValueInNCS(zVal),m_normalInCamFrame(normalCam),
				m_ambientColor(ambientColor),m_diffuseColor(diffuseColor),m_specularColor(specularColor){}
} VertexData;

typedef enum ShadingMode {SHAD_UNSPEC, SHAD_LINE, SHAD_TRIANGLE};


class Shader {
protected:
	
	ShadingMode m_shadingMode;
	// all of the following pointers are allocatd outside the class,
	// so the shader must NOT delete them!
	const Material * m_material; 
	const VertexData * m_vd1;
	const VertexData * m_vd2;
	const VertexData * m_vd3;

public:
	Shader(const vector<LightSource*> * const lightSources);
	inline void setMaterial(const Material * const m) { m_material = m; }
	void setLineData(const VertexData * vd1, const VertexData * vd2);
	void setTriangleData(const VertexData * const vd1, const VertexData * const vd2, const VertexData * const vd3);
	virtual void calculateColorAndDepth(GLfloat & z, vec3 & colorComponents)=0;
	virtual ~Shader()=0;
};
*/


//  this is the simplest of shaders...
class FlatShader : public Shader {
	FlatShader(const vector<LightSource*> const * lightSources):Shader(lightSources){}
	virtual void calculateColorAndDepth(GLfloat & z, vec3 & colorComponents);
};

class GShader : public Shader {
public:
	GShader(vector<LightSource*> * v);
	virtual void calculateColorAndDepth(GLfloat & z, vec3 & colorComponents);
};

class PShader : public Shader {
	PShader(vector<LightSource*> * v);
	virtual void calculateColorAndDepth(GLfloat & z, vec3 & colorComponents);
};